home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
423
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
2KB
Path: tko.dec.com!diamond
From: diamond@tko.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: CLOCKS_PER_SEC not defined
Date: 19 Feb 1996 03:14:28 GMT
Organization: Digital Equipment Corporation Japan , Tokyo
Message-ID: <4g8puk$2ce@usenet.pa.dec.com>
References: <ramin.1174728902A@news.gsfc.nasa.gov>
Reply-To: diamond@jrdv04.enet.dec-j.co.jp (Norman Diamond)
NNTP-Posting-Host: jit533.tko.dec.com
In article <ramin.1174728902A@news.gsfc.nasa.gov>, ramin@twinkie.gsfc.nasa.gov (Ramin Sina) writes:
>I am using a supposedly ansi c program in which I write
Do you mean you are using a supposedly ANSI C implementation? If the
vendor's documents assert that it is, and if you have followed the
vendor's instructions for invoking it (i.e. if you have not opted,
whether by default or by specifying an option, for a non-conforming
implementation) then you should get a refund.
If you mean that you are writing a supposedly ANSI C program, then
your test for __STDC__ is meaningless :-)
If you mean that you want to cover most bases, then check if __STDC__
is defined with value 1. Some non-conforming implementations define
__STDC__ with value 0 just to be malicious. Some non-conforming
implementations define __STDC__ with value 1 in order to be fraudulent.
The C standard cannot constrain non-conforming implementations but you
can demand a refund from a fraudulent vendor.
>#include <time.h>
>#if defined(__STDC__) && !defined(CLOCKS_PER_SEC)
>#error "CLOCKS_PER_SEC is not defined on this stupid compiler"
>#endif
Try:
#include <time.h>
#if defined(__STDC__) && __STDC__ == 1 && !defined(CLOCKS_PER_SEC)
#error "Get a refund from the fraudulent vendor of this implementation"
#endif
--
<< If this were the company's opinion, I would not be allowed to post it. >>
"I paid money for this car, I pay taxes for vehicle registration and a driver's
license, so I can drive in any lane I want, and no innocent victim gets to call
the cops just 'cause the lane's not goin' the same direction as me" - J Spammer